<%@page import="bll.EnumName"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="java.util.*,util.*,dal.*,model.*, bll.*"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Add New Company</title>
<link rel="stylesheet" href="css/common.css" />
<link rel="stylesheet" href="css/inputForm.css" />
<link rel="stylesheet" href="css/listForm.css" />
<link rel="stylesheet" href="css/jquery-ui-1.8.14.custom.css" type="text/css" />
<link rel="stylesheet" href="css/hyjack.css" type="text/css" />
<link rel="stylesheet" href="css/datepicker.css" type="text/css" />
<link rel="stylesheet" href="css/themes/ui-lightness/jquery.ui.all.css" />
<link rel="stylesheet" href="css/jquery-ui-timepicker.css" type="text/css" />
<link rel="stylesheet" href="css/jquery-datepicker.css" />
<link rel="stylesheet" href="css/jquery-dialog.css" />

<script language="javascript" type="text/javascript" src="js/datepicker.js"></script>
<script language="javascript" type="text/javascript" src="js/jquery-1.6.1.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.14.custom.min.js"></script>
<script language="javascript" type="text/javascript" src="js/jquery.hyjack.select.js"></script>
<script language="javascript" type="text/javascript" src="js/jquery.ui.core.min.js"></script>
<script language="javascript" type="text/javascript" src="js/jquery.ui.widget.min.js"></script>
<script language="javascript" type="text/javascript" src="js/jquery.ui.timepicker.js"></script>
<script language="javascript" type="text/javascript" src="js/jquery.ui.datepicker.js"></script>
<script language="javascript" type="text/javascript" src="js/datepicker.js"></script>
<script language="javascript" type="text/javascript" src="js/jquery.hyjack.js"></script>
<script language="javascript" type="text/javascript" src="js/ajaxQuickInsert.js"></script>
<script language="javascript" type="text/javascript" src="js/jquery.numeric.js"></script>
<script language="javascript" type="text/javascript" src="js/jquery.ui.tools.min.js"></script>
<script language="javascript" type="text/javascript" src="js/common.js"></script>


<script language="javascript" type="text/javascript">
$(document).ready(pageLoaded);

function pageLoaded()
{
	turnOnNumbericInput();
	initTooltip();	
} 

var requiredInputs = [['short_name','short_name_required']];
var intInputs = [];
var doubleInputs = [];
var dateInputs = [];
var timeInputs = [];


function checkInputs() {
	var valid = true;

	if (checkRequiredInputs(requiredInputs) == false) {
		valid = false;
	}
	if (checkIntInputs(intInputs) == false) {
		valid = false;
	}
	if (checkDoubleInputs(doubleInputs) == false) {
		valid = false;
	}
	if (checkDateInputs(dateInputs) == false) {
		valid = false;
	}
	if (checkTimeInputs(timeInputs) == false) {
		valid = false;
	}

	// SPECIFIC VALIDATE CODE HERE		

	return valid;
}

	
</script>
</head>
<body>
	<div class="divContainer">
		<jsp:include page="menu.jsp"></jsp:include>
				<form id="inputForm" action="company?mode=insert" method="post" onSubmit="return checkInputs()">
					<table class="tblInput">
						<tr>
							<td class="inputHeader">ADD NEW COMPANY</td>
						</tr>
						<tr>
					<td style="padding-left: 400px; padding-right: 400px;">
						<table cellspacing="0px">
						<tr class="trField">
							<td class="tdFieldName">Abb Name</td>
							<td class="tdFieldInput">
								<input class="inputText" type="text" id="abb_name" name="abb_name" maxlength="10" title="Abb name of new company." />
							</td>
							<td class="tdErrMsg">
							</td>
						</tr>
						<tr class="trField">
							<td class="tdFieldName">Short Name</td>
							<td class="tdFieldInput">
								<input class="inputText" type="text" id="short_name" name="short_name" maxlength="25" title="Short name of new company. Note: Required." onblur="validateRequiredInput('short_name');"/>
							</td>
							<td class="tdErrMsg">
								<span id="short_name_required" class="errMsg" style="display: none;" title="Short name is required">(!)</span> 
								<span id="short_name_invalid" class="errMsg" style="display: none;" title="Short name is invalid"></span>
							</td>
						</tr>
						<tr class="trField">
							<td class="tdFieldName">Full Name</td>
							<td class="tdFieldInput">
								<input class="inputText" type="text" id="full_name" name="full_name" maxlength="255" title="Full name of new company." />
							</td>
							<td class="tdErrMsg">
							</td>
						</tr>
						<tr class="trField">
							<td class="tdFieldName">Foreign Name</td>
							<td class="tdFieldInput">
								<input class="inputText" type="text" id="foreign_name" name="foreign_name" maxlength="255" title="Foreign name of new company." />
							</td>
							<td class="tdErrMsg">
							</td>
						</tr>
						<tr class="trField">
							<td class="tdFieldName">Address</td>
							<td class="tdFieldInput">
								<textarea id="address" name="address" rows="5" class="inputTextarea" title="Address of new company."></textarea>
							</td>
							<td class="tdErrMsg">
							</td>
						</tr>
						<tr class="trField">
							<td class="tdFieldName">Telephone</td>
							<td class="tdFieldInput">
								<input class="inputText" type="text" id="mobile" name="mobile" maxlength="13" onkeydown="phoneNumberTextKeyDown(event, this);" onkeyup="phoneNumberTextKeyUp(this);" title="Phone number of new company. Format: (+)xxxxx..."  />
							</td>
							<td class="tdErrMsg">
							</td>
						</tr>
						<tr class="trField">
							<td class="tdFieldName">Tax Code</td>
							<td class="tdFieldInput">
								<input class="inputInt" type="text" id="tax_code" name="tax_code" maxlength="10" title="Tax code of new company. Note: Integer only." />
							</td>
							<td class="tdErrMsg">
							</td>
						</tr>
						<tr class="trField">
							<td class="tdFieldName">Description</td>
							<td class="tdFieldInput">
								<textarea id="description" name="description" rows="5" class="inputTextarea" title="Description for new company."></textarea>
							</td>
							<td class="tdErrMsg">
							</td>
						</tr>
						<tr class="trInputBottom">
							<td class="trInputBottom" colspan="3">
								<table class="tblSubmit" align="center">
									<tr class="trSubmit">
										<td class="tdSubmit"><input class="btnSubmit" type="submit" value="Submit" title="Click to add company." />
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</form>
	<%
	
		String urlCompanyList = "companyList.jsp?embedded=true";
	%>
		<jsp:include page='<%=urlCompanyList%>'></jsp:include>
	</div>
</body>
</html>